diff options
Diffstat (limited to 'app/[lng]/evcp/(evcp)/(procurement)/bid/page.tsx')
| -rw-r--r-- | app/[lng]/evcp/(evcp)/(procurement)/bid/page.tsx | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/app/[lng]/evcp/(evcp)/(procurement)/bid/page.tsx b/app/[lng]/evcp/(evcp)/(procurement)/bid/page.tsx index 3a45e61f..aa9f33b5 100644 --- a/app/[lng]/evcp/(evcp)/(procurement)/bid/page.tsx +++ b/app/[lng]/evcp/(evcp)/(procurement)/bid/page.tsx @@ -7,6 +7,7 @@ import { getBiddingTypeCounts, getBiddingManagerCounts, getBiddingMonthlyStats, + getUserCodeByEmail, } from "@/lib/bidding/service" import { searchParamsCache } from "@/lib/bidding/validation" import { BiddingsPageHeader } from "@/lib/bidding/list/biddings-page-header" @@ -32,12 +33,26 @@ export default async function BiddingsPage(props: IndexPageProps) { const validFilters = getValidFilters(search.filters) + // ✅ 입찰 데이터를 먼저 가져옴 + const biddingsResult = await getBiddings({ + ...search, + filters: validFilters, + }) + + // ✅ 입찰 데이터에 managerCode 추가 + const biddingsDataWithManagerCode = await Promise.all( + biddingsResult.data.map(async (item) => { + let managerCode: string | null = null + if (item.managerEmail) { + managerCode = await getUserCodeByEmail(item.managerEmail) + } + return { ...item, managerCode: managerCode || null } + }) + ) + // ✅ 모든 데이터를 병렬로 로드 const promises = Promise.all([ - getBiddings({ - ...search, - filters: validFilters, - }), + Promise.resolve({ ...biddingsResult, data: biddingsDataWithManagerCode }), getBiddingStatusCounts(), getBiddingTypeCounts(), getBiddingManagerCounts(), |
